package featureExtraction;

import java.awt.image.BufferedImage;
import java.util.*;


public class TokenCollection {

	public List<TokenRaw> Tokens;
	
	public TokenCollection(BufferedImage image)
	{

		Tokens = new ArrayList<TokenRaw>();
	}

	
	public void AddCharToken(TokenRaw token)
	{

		Tokens.add(token);
	}

	public void CleanTokenCollection()
	{
		for (int i = 0; i < Tokens.size(); i++)
		{
			TokenRaw token = Tokens.get(i);
			if ((token.X1 - token.X0) * (token.Y1 - token.Y0) <= 4)
			{
				RemoveToken(Tokens.get(i));
				i--;
			}
		}
	}
	
	public void RemoveToken(TokenRaw token)
	{

		Tokens.remove(token);
	}
}
